<template>
  <components :is="currentComponent" :vcodeSrc="vcodeSrc" @submit="onSubmit"></components>
</template>

<script>
import LoginBox1 from "./login-box-1";
import LoginBox2 from "./login-box-2";
import LoginBox3 from "./login-box-3";
import LoginBox4 from "./login-box-4";
export default {
  props: {
    type: {
      type: [Number, String],
      default: 1,
    },
    vcodeSrc:{
      type: String,
      default: ''
    }
  },
  name: "data-v-login-box",
  components: {
    LoginBox1,
    LoginBox2,
    LoginBox3,
    LoginBox4,
  },
  computed: {
    currentComponent() {
      return "login-box-" + this.type;
    },
  },
  methods:{
    onSubmit(isValid, values){
      this.$emit("submit", isValid, values);
    }
  }
};
</script>

<style src="./login.less" lang="less"></style>
